$(document).ajaxSend(function (e,xhq,opt) {
    let token = localStorage.getItem("user_token");
    let user_token = localStorage.getItem("user_token");
    xhq.setRequestHeader("user_token_header", user_token);
});
function getUserInfo(url) {
    $.ajax({
        type: "GET",
        url: url,
        success: function (result) {
            if (result.code == "SUCCESS" && result.data != null) {
                let userInfo = result.data;
                $(".left .card h3").text(userInfo.userName);
                $(".left .card a").attr("href", userInfo.githubUrl);
                console.log(userInfo.count);
                $(".left .card .row .count").text(userInfo.count);
            }else {
                alert(result.msg)
            }

        },
        error:function(error) {
            if (error != null && error.status == 401) {
                location.href="blog_login.html";
            }
        }
    })
};
function logout() {
    localStorage.removeItem("user_token");
    location.href="blog_login.html";
}
